public class MyQuen {
    static class Listnode{
        public int val;
        public Listnode prev;
        public  Listnode next;
        public Listnode(int val) {
            this.val = val;
        }
        public int Usedsize;
        public Listnode first=null;
        public Listnode last=null;
        public void offer(int val){//尾插
            Listnode node=new Listnode(val);
            if(isempty()){
                first=last=node;
            }else {
                last.next=node;
                node.prev=last.prev;
                last=last.next;
            }
            Usedsize++;
        }
        public boolean isempty(){
            return Usedsize==0;
        }
    }
}
